package com.cty.graph;

public class GraphDemo {
    public static void main(String[] args) {
        String[] vertexs = {"A","B","C","D","E"};
        Graph graph = new Graph(5);
        for (String vertex : vertexs) {
            graph.insertVertex(vertex);
        }
        graph.insertEdge(0,1,1);
        graph.insertEdge(0,2,1);
        graph.insertEdge(0,2,1);
        graph.insertEdge(1,2,1);
        graph.insertEdge(1,3,1);
        graph.insertEdge(1,4,1);
        graph.showEdges();
        System.out.println("顶点的总数："+graph.numOfVertex());
        System.out.println("路径的总数："+graph.getNumOfEdges());
        System.out.println("A -> B的路径权值:" + graph.getWeight(0, 1));
//        graph.dfs();
        graph.bfs();
    }
}
